package book;

public class Book {

    private String name;//书名
    private String author;//作者
    private String type;//类型
    private int price;//价格
    private boolean ifBorrowed;//是否被借出

    public Book(String name, String author, String type, int price) {
        this.name = name;
        this.author = author;
        this.type = type;
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public boolean isIfBorrowed() {
        return ifBorrowed;
    }

    public void setIfBorrowed(boolean ifBorrowed) {
        this.ifBorrowed = ifBorrowed;
    }

    @Override
    public String toString() {
        return "凯旋图书馆：{" +
                "书名='" + name + '\'' +
                ", 作者='" + author + '\'' +
                ", 类型='" + type + '\'' +
                ", 价格=" + price +
                ((ifBorrowed == true) ? " ,被借出" : " ,未借出") +
                '}';
    }
}